@import '../common/style/var.less';
@import '../common/style/theme.less';

:host {
  width: 100%;
}

.van-image {
  position: relative;
  display : inline-block;
  overflow: hidden;

  &--round {
    overflow     : hidden;
    border-radius: 50%;

    // .van-image__img {
    //   border-radius: inherit;
    // }
  }

  &__img {
    &--scaleToFill {
      img {
        object-fit: fill
      }
    }

    &--heightFix {
      img {
        height: 100%;
      }
    }
  }

  &__img,
  &__error,
  &__loading {
    display: block;
    width  : 100%;
    height : 100%;
  }

  &__error,
  &__loading {
    position       : absolute;
    top            : 0;
    left           : 0;
    display        : flex;
    flex-direction : column;
    align-items    : center;
    justify-content: center;
    .theme(color, '@image-placeholder-text-color');
    .theme(font-size, '@image-placeholder-font-size');
    .theme(background-color, '@image-placeholder-background-color');
  }

  /** 默认值 */
  // width   : 320px;
  // height  : 240px;
  // overflow: hidden;
}
